<?php

namespace App\Jobs\Logic\Account;

use App\Repositories\AttendanceRepository;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;

class Signin implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $attendance;

    /**
     * Signin constructor.
     * @param array $attendance
     */
    public function __construct(array $attendance)
    {
        $this->attendance = $attendance;
    }

    /**
     * 执行任务
     *
     * Date: 22/04/2018
     * @author George
     * @param AttendanceRepository $attendanceRepository
     */
    public function handle(AttendanceRepository $attendanceRepository)
    {
        $attendanceRepository->createOrUpdate($this->attendance);
    }
}
